#include<stdio.h>
#include<cstring>
#include<algorithm>

using namespace std;

#define N 100



int main()
{
	int n;
	
	scanf("%d", &n);
	
	while(n--)
	{
		char s[N];
		scanf("%s", s);
		reverse(s, s+strlen(s));	
		printf("%s\n", s);
	}
		
	return 0;
}



